package com.img.test;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class ImagePanel extends JPanel{
	public ImagePanel() {
	}

	
	private double xuanzhuan;
	
	private Image image;
	
	
	
	@Override
	protected void paintComponent(Graphics g) {
g.clearRect(0, 0, 64, 64);
		Graphics2D g2d = (Graphics2D) g;
//		g2d.fillRect(0, 0, 64, 64);
		g2d.rotate(xuanzhuan, 32, 32);
		
		image = new ImageIcon("./img/chilun2.png").getImage();
		
		g2d.drawImage(image, 0,0,this);
		
		g2d.setColor(ImagePanel.this.getBackground());
		g.dispose();
	}



	public void setXuanzhuan(double xuanzhuan) {
		this.xuanzhuan = xuanzhuan;
	}
	
	
	
}
